# Maintainer: Jaroslav Lichtblau <svetlemodry@archlinux.org> 
# Contributor: Stefan Husmann <stefan-husmann@t-online.de>
# Contributor: Søren Holm <sgh@sgh.dk> 

pkgname=vym
pkgver=2.8.8
pkgrel=1
pkgdesc="A mindmapping tool"
arch=('loong64' 'x86_64')
url="https://www.insilmaril.de/vym/"
license=('GPL')
depends=('qt5-svg' 'qt5-script' 'desktop-file-utils' 'zip' 'unzip')
makedepends=('qt5-tools')
changelog=$pkgname.changelog
source=(https://downloads.sourceforge.net/sourceforge/$pkgname/$pkgname-$pkgver.tar.bz2
        $pkgname.desktop)
sha256sums=('405b6d58ea4a201e7aa32f2b65c61d3bec50f914486d02394842bdd7f8f41f08'
            'e299c69c213e7aac3f5b5d0ab088132b4ec7cb63a391f272e75ed64f049d541b')

prepare() {
  cd "${srcdir}"/$pkgname-$pkgver/lang

  lrelease *.ts
}

build() {
  cd "${srcdir}"/$pkgname-$pkgver

  qmake PREFIX=/usr/share
  make
}

package() {
  cd "${srcdir}"/$pkgname-$pkgver

# install files
  make INSTALL_ROOT="${pkgdir}" install

# install documentation
  install -Dm644 "${srcdir}"/$pkgname-$pkgver/doc/$pkgname.1.gz \
    "${pkgdir}"/usr/share/man/man1/$pkgname.1.gz
  install -Dm644 "${srcdir}"/$pkgname-$pkgver/doc/$pkgname.pdf \
    "${pkgdir}"/usr/share/doc/$pkgname/$pkgname.pdf  
  rm -rf "${pkgdir}"/usr/share/doc/packages

# .desktop and icon file
   install -Dm644 "${srcdir}"/$pkgname.desktop \
     "${pkgdir}"/usr/share/applications/$pkgname.desktop
   install -Dm644 "${pkgdir}"/usr/share/vym/icons/$pkgname.png \
     "${pkgdir}"/usr/share/pixmaps/$pkgname.png
}
